﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using StockFinder.GoogleFinance;
using StockFinder.Model;

namespace Testharness
{
    public partial class GoogleFinanceTestForm : Form
    {
        public GoogleFinanceTestForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var gf = new GoogleFinanceOnlineStockPriceHistoryExtractor();

            var prices = gf.GetHistoricPrices(new Symbol() { Name = "AAPL" }, new DateTime(2010, 11, 1), new DateTime(2012, 11, 1));


        }

        private void button2_Click(object sender, EventArgs e)
        {
            DateTime fromDate = new DateTime(2010, 11, 12);

            string startDate = string.Format("{0}%{1}", fromDate.ToString("MMM+dd"), fromDate.ToString("2C+yyyy"));

            string testDateFormat = "Nov+12%2C+2010";

            var match = testDateFormat == startDate;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            var gf = new GoogleFinanceOnlineStockPriceHistoryExtractor();

            var prices = gf.GetHistoricPrices(new Symbol() { Name = "AAPL" }, new DateTime(2010, 11, 1), new DateTime(2012, 11, 1));


        }
    }
}
